package net.soevar.database.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(schema = "public", name = "ath_menu")
public class AthMenu implements Serializable {
	private static final long serialVersionUID = -1067530988598002137L;
	private Long id;
	private String label;
	private Integer root;
	private Integer child;
	private String url;
	private String icon;
	private Boolean status;
	private String dirubahOleh;
	private Date dirubahTanggal = new Date();

	public AthMenu() {

	}

	public AthMenu(Integer root, Integer child) {
		this.root = root;
		this.child = child;
	}

	public AthMenu(Integer root, Integer child, String label) {
		this.root = root;
		this.child = child;
		this.label = label;
	}

	public AthMenu(Integer root, Integer child, String label, String url) {
		this.root = root;
		this.child = child;
		this.label = label;
		this.url = url;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", insertable = false, unique = true, nullable = false)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "label", nullable = true, length = 100)
	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	@Column(name = "root", nullable = true)
	public Integer getRoot() {
		return root;
	}

	public void setRoot(Integer root) {
		this.root = root;
	}

	@Column(name = "child", nullable = true)
	public Integer getChild() {
		return child;
	}

	public void setChild(Integer child) {
		this.child = child;
	}

	@Column(name = "url", length = 100)
	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	@Column(name = "icon", length = 255)
	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	@Column(name = "status")
	public Boolean getStatus() {
		return status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

	@Column(name = "dirubah_oleh", length = 100)
	public String getDirubahOleh() {
		return dirubahOleh;
	}

	public void setDirubahOleh(String dirubahOleh) {
		this.dirubahOleh = dirubahOleh;
	}

	@Column(name = "dirubah_tanggal")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getDirubahTanggal() {
		return dirubahTanggal;
	}

	public void setDirubahTanggal(Date dirubahTanggal) {
		this.dirubahTanggal = dirubahTanggal;
	}

}
